package models

import "tuowei.com/common/models"

type SysQuestionBank struct {
	SubjectType string `json:"subject_type" gorm:"type:varchar(10);not null;comment:题目类型"`
}

func (SysQuestionBank) TableName() string {
	return "sys_question_bank"
}

type SysQuestionBankInsert struct {
	models.Model
	SubjectType   string `json:"subject_type" gorm:"type:int(10);comment:题目类型"`
	ExerciseType  int    `json:"exercise_type" gorm:"type:varchar(10);not null;comment:网课=1/题库=2/3=试卷"`
	Content       string `json:"content" gorm:"type:text;comment:题目内容"`
	Answer        string `json:"answer" gorm:"type:text;not null;comment:答案"`
	CorrectAnswer string `json:"correct_answer" gorm:"type:text;comment:正确答案"`
	Analysis      string `json:"analysis" gorm:"type:text;comment:题目解析"`
	models.ModelTime
}

func (SysQuestionBankInsert) TableName() string {
	return "sys_question_bank"
}

type QuestionBankList struct {
	Id            int    `json:"id"`
	SubjectType   string `json:"subject_type" gorm:"type:varchar(20);comment:题目类型"`
	Content       string `json:"content" gorm:"type:text;comment:题目内容"`
	Answer        string `json:"answer" gorm:"type:text;not null;comment:答案"`
	CorrectAnswer string `json:"correct_answer" gorm:"type:text;comment:正确答案"`
	Analysis      string `json:"analysis" gorm:"type:text;comment:题目解析"`
	Status        int    `json:"status" gorm:"-"`
	LinkId        int    `json:"link_id" gorm:"-"`
	LinkTitle     string `json:"link_title" comment:"错误记录标题" gorm:"-"`
	ExType        int    `json:"ex_type" gorm:"-"  comment:"所属练习错误记录类型"`
	Nums          int    `json:"nums" gorm:"-" comment:"错误次数"`
}

func (QuestionBankList) TableName() string {
	return "sys_question_bank"
}
